import request from '@/utils/request';
import qs from 'qs';

// 获取用户信息
export function userData(memberId) {
  return request({
    url: `/v1/risk/particulars/get_member_detailV2`,
    method: 'get',
    params: { memberId }
  });
}

// 获取金币零钱历史记录
export function getCoinCashList(memberId) {
  return request({
    url: `/v1/risk/particulars/get_coin_cash_list`,
    method: 'get',
    params: { memberId }
  });
}

// 获取零钱转出历史数据
export function getWithdrawList(memberId) {
  return request({
    url: `/v1/risk/particulars/get_cash_expend_list`,
    method: 'get',
    params: { memberId }
  });
}

// 获取设备使用历史数据
export function getDeviceUseList(memberId, pageNum, pageSize) {
  return request({
    url: `/v1/risk/particulars/get_device_use_page?memberId=${memberId}&size=${pageSize}&page=${pageNum}`,
    method: 'get'
  });
}

// 获取所有事件类型
export function getApiTypeListApi() {
  return request({
    url: `/v1/risk/particulars/get_api_type_list`,
    method: 'get'
  });
}

// 获取会员近7天的地理位置列表
export function getMemberLocationList(memberId) {
  return request({
    url: `/v1/risk/particulars/get_member_location_list?memberId=${memberId}`,
    method: 'get'

  });
}

// 获取城市
export function getAllCityApi(query) {
  return request({
    url: '/v1/risk/particulars/get_location_of_visit_log',
    method: 'get',
    params: query
  });
}

// 获取用户访问行为历史记录
export function getApiVisitLogPageApi(query) {
  return request({
    url: '/v1/risk/particulars/get_api_visit_log_page',
    method: 'get',
    params: query
  });
}

// 获取金币红包活动历史记录
export function getMemberActionListApi(params) {
  return request({
    url: `/v1/risk/particulars/get_member_action_listV2`,
    method: 'get',
    params
  });
}

// 阅读任务红包明细
export function getReadrecordApi(query) {
  return request({
    url: `/v1/analysis/mission/readrecord`,
    method: 'post',
    data: query
  });
}

// 获取会员基本信息
export function getMemberInfoApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_detailV3',
    method: 'get',
    params: query
  });
}

// 获取会员风控信息
export function getMemberRiskInfoApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_risk_info',
    method: 'get',
    params: query
  });
}

// 邀请好友任务汇总
export function getAcquisitionApi(query) {
  return request({
    url: '/v1/risk/particulars/get_acquisition_child_outline',
    method: 'get',
    params: query
  });
}

// 会员状态变更详情
export function getChangeRecordsApi(query) {
  return request({
    url: `/v1/memberrisk/getMemberChangeRecords`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: qs.stringify(query)
  });
}

// 风控信息零钱报表
export function getRiskInfoCashApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_risk_info_cash',
    method: 'get',
    params: query
  });
}

// 风控信息金币报表
export function getRiskInfoCoinApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_risk_info_coin',
    method: 'get',
    params: query
  });
}

// 邀请好友任务报表
export function getChildReportApi(query) {
  return request({
    url: '/v1/risk/particulars/get_acquisition_child_report',
    method: 'get',
    params: query
  });
}

// 风控信息金币明细
export function getRiskInfoCoinDetailApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_risk_info_coin_detail',
    method: 'get',
    params: query
  });
}

// 风控信息零钱明细
export function getRiskInfoCashDetailApi(query) {
  return request({
    url: '/v1/risk/particulars/get_member_risk_info_cash_detail',
    method: 'get',
    params: query
  });
}
